package com.example.controller;

import com.example.service.JobClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/job-classes")
@CrossOrigin
public class JobClassController {

    @Autowired
    private JobClassService jobClassService;

    @GetMapping
    public ResponseEntity<List<Map<String, String>>> getAllJobClasses() {
        return ResponseEntity.ok(jobClassService.getAllJobClasses());
    }
}